#include <stdio.h>
#include <math.h>

int main()
{
    int M;
    int N;
    int ge;
    int shi;
    int bai;
    int sum;
    int i;
    scanf("%d %d",&M,&N);
    if(M <= N && M >= 100 && M <= 999 && N >= 100 && N <= 999){
        for(i=M;i<=N;i++){
            ge = i % 10;
            shi = i / 10 % 10;
            bai = i / 100;
            sum = pow(ge,3) + pow(shi,3) + pow(bai,3);
            if(i == sum){
                printf("%d\n",i);
            }
        }
    }else{
        printf("Invalid Value.\n");
    }

    return 0;
}